package cn.tedu.shoot;

import java.awt.image.BufferedImage;
import java.util.Random;

/**
 * 小敌机:是飞行物
 */
public class  AirPlane extends FlyingObject {
    private int speed;  //移动速度
    public AirPlane(){
        super(48,50);
        speed = 2;
    }

    private int index = 1;

    public BufferedImage getImage(){
        if(isLive()){
            return  Images.airs[0];
        }else if(isDead()) {
            BufferedImage img = Images.airs[index++];
            if(index==Images.airs.length){
                state = REMOVE;
            }
            return img;
        }
        return null;
    }
}
